package com.huo.filestransport.controller;

import java.util.List;
import java.util.Map;

import com.huo.filestransport.entity.FtpFileInfoEntity;
import com.huo.filestransport.entity.Ftpfilelog;
import com.huo.filestransport.service.TransportMonitorService;
import com.huo.util.PageUtils;
import com.huo.util.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/ftp")
public class TransportMonitorController {
	
	@Autowired
	private TransportMonitorService transportMonitorService;
	
	@GetMapping("/ftpFileInfolist")
	@ResponseBody
	public PageUtils ftpFileInfoList(@RequestParam Map<String, Object> params) {
		Query query = new Query(params);
		List<FtpFileInfoEntity> list = transportMonitorService.ftpFileInfoList(query);
		int total = transportMonitorService.selectCount(query);
		PageUtils pageUtil = new PageUtils(list, total);
		return pageUtil;
	}
	
	@GetMapping("/ftpFileLoglist")
	@ResponseBody
	public PageUtils ftpFileLogList(@RequestParam Map<String, Object> params) {
		Query query = new Query(params);
		List<Ftpfilelog> list = transportMonitorService.ftpfilelogList(query);
		int total = transportMonitorService.selectLogCount(query);
		PageUtils pageUtil = new PageUtils(list, total);
		return pageUtil;
	}
	

}
